#pragma once
///////////////////////////////////////////////////////////////////////////////////////////////////
// GERPGStatus.h
// Tuesday, July 20, 2010
// Copyright ?2009, 2010, 8DWorld, Inc. All rights reserved.
//
// $Description$
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "gene\unitgene.h"
#include "Util/Movable2DPicture.h"

class GERPGStatus :
    public UnitGene
{
public:
    GERPGStatus(void);
	GERPGStatus(int nStatusID);
    virtual ~UGRPGStatus(void);

    // 
	//	Fire when the gene is attached on a unit. just like unit enter the state.
	//
	virtual bool OnAttach();

	// 
	//	Fire when the gene is detached from a unit. just like unit leave the state.
	//
	virtual bool OnDetach();

    // 
	//	Periodically update gene logic, normally a gene will be detach when run out of its time to live.
	//
	virtual bool OnUpdate(int nElapse);

    void SetStatusId(int nId);
protected:
     
    bool OnUpdatePosition();

private:
    int m_nStatusId;
    Movable2DPicture* m_pMovablePic;
    Ogre::SceneNode* m_pSceneNode; //Which is used to control the 2D picture
    Vector3 m_ptStart;
    Vector3 m_ptVector; //The target poistion 
    int m_nExistTime;
    Vector4 m_area1;
    Vector4 m_area2;


};

